package com.zjitc.dao;

import com.zjitc.model.Product;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * Create by IntelliJ IDEA
 *
 * @author: MaoYongQi
 * @date-Time: 2018/4/2 10:40
 * @description:
 */
public interface ProductDao {

  /**
   * select Product  orderBY
   * @param orderBy
   * @return
   */
  List<Product> findProductOrderBy(String orderBy);

  /**
   * select detail by productId
   * @param productId
   * @return
   */
  Product finddetail(Integer productId);

  /**
   * select All product count
   * @return
   */
  int findAllCount();

  /**
   * select All product
   * @return
   */
  List<Product> findAllProduct();

  /**
   * select product where name and id
   * @param name
   * @param Id
   * @return
   */
  List<Product> findByNameAndID(String name, String Id);

  /**
   * 产品上下架
   * @param productId
   * @param status
   */
    void updateStatusById(Integer productId, Integer status);

  /**
   * @param product
   */
  void addProduct(Product product);

  void updateProduct(Product product);

}
